package com.zsc.wxapp.controller.businessUser;

import com.zsc.wxapp.context.BaseContext;
import com.zsc.wxapp.entity.vo.UserInfoVO;
import com.zsc.wxapp.result.Result;
import com.zsc.wxapp.services.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("businessUserController")
@RequestMapping("/api/wxapp/businessUser")
//@Api(tags = "B端-用户相关接口")
@Slf4j
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/getUserInfo")
//    @ApiOperation("获取用户详细信息")
    public Result<UserInfoVO> getUserInfo() {
        Long userid = BaseContext.getCurrentId();
        log.info("当前操作的用户id是，id：{}", userid);
        return Result.success(userService.getUserInfo(userid));
    }
}
